/**
 *    Copyright 2009-2016 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.reflection.factory;

import java.util.List;
import java.util.Properties;

/**
 *  mybatis之中创建对象使用的工厂,对象工厂
 */
public interface ObjectFactory {

  /**
   * 设置配置属性
   * @param properties
   */
  void setProperties(Properties properties);

  
  /**
   * 给定一个类型,使用默认的构造函数创建对象
   * @param type
   * @return
   */
  <T> T create(Class<T> type);

  /**
   * 通过一个含有参数的构造器创建对象.
   * @param type 创建出的对象的类型
   * @param constructorArgTypes 构造器之中参数的类型列表
   * @param constructorArgs  参数列表对应的实参
   * @return
   */
  <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs);
  
  
  /**
   * 判断一个对象是否是一个集合类型,这个集合类型代表的含义就是能存储其他对象的对象类型
   * @param type
   * @return
   */
  <T> boolean isCollection(Class<T> type);

}
